package com.spsy.pay.listener;

import com.spsy.pay.service.IPaymentOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author: liuzhiping
 * @date: 2025/9/23 14:07
 **/
@Component
//@RabbitListener(queues = RabbitmqConstant.MQ_NAME)
@Slf4j
public class RabbitmqLisener {


    @Autowired
    private IPaymentOrderService iPaymentOrderService;
//
//    @Autowired
//    private OrderApi orderApi;

//    @RabbitHandler
//    public void handler(String str, Message message, Channel channel) {
//        log.info("接受到的信息 ------str：{}", str);
//
//
//        try {
//
//            OrderMqVo orderMqVo = JSON.parseObject(str, OrderMqVo.class);
//
//
//            int updateCount = this.iPaymentOrderService.updatePaymentOrderByOrderId(PaymentOrder.builder().orderNo(orderMqVo.getOrderId()).orderStatus(Integer.valueOf(orderMqVo.getStatus())).build());
//
//            NotifyPay2OrderVo notifyPay2OrderVo = new NotifyPay2OrderVo();
//            notifyPay2OrderVo.setOrderId(orderMqVo.getOrderId());
//            notifyPay2OrderVo.setStatus(2);
//
//            System.out.println("11111111111");
//
//            //本质上有是执行一个http请求
//            //回调通过订单系统
//            this.orderApi.createOrder(notifyPay2OrderVo);//30s+200ms*/
//        } catch (Exception e) {
//            log.info("异常：{}", e.getMessage());
//        }
//    }
}

